//
//  InfoView.m
//  EWangTong
//
//  Created by 李 佳伟 on 2017/10/27.
//  Copyright © 2017年 李 佳伟. All rights reserved.
//

#import "InfoView.h"
#import "JTCSM.h"
static     CGFloat space = 15;

@implementation InfoView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (id)initWithFrame:(CGRect)frame showtype:(showType)type;
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel = [UILabel initWithFrame:CGRectMake(space, 0, frame.size.width/2-space, frame.size.height) text:@"" font:14 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(46,51,47,1)  backgroundColor:nil];
        self.titleLabel.userInteractionEnabled = YES;
        [self addSubview:self.titleLabel];
        if (type == showLabelType) {
            self.contentLabel = [UILabel initWithFrame:CGRectMake(frame.size.width/2, 0, frame.size.width/2-space, frame.size.height) text:@"" font:15 textAlignment:NSTextAlignmentRight texcolor:RGBACOLOR(46,51,47,1)  backgroundColor:nil];
            self.contentLabel.userInteractionEnabled = YES;
            [self addSubview:self.contentLabel];
            
            _line = [[UIView alloc]initWithFrame:CGRectMake(0, frame.size.height-1, self.bounds.size.width, 1)];
            _line.backgroundColor = RGBACOLOR(241,241,241,.5);
            [self addSubview:_line];

        }else if(type == showimageType){
            CGFloat imagevsize = 18;
            UIImageView *returnImageV  = [[UIImageView alloc]initWithFrame:CGRectMake(frame.size.width-imagevsize-space, (frame.size.height-imagevsize)/2, imagevsize, imagevsize)];
            returnImageV.image = [UIImage imageNamed:@"myInfoReturn.png"];
            returnImageV.userInteractionEnabled = YES;
            [self addSubview:returnImageV];
            
            _line = [[UIView alloc]initWithFrame:CGRectMake(0, frame.size.height-1, self.bounds.size.width, 1)];
            _line.backgroundColor = RGBACOLOR(241,241,241,.5);
            [self addSubview:_line];

            
        }else if(type == showNULLType){
            [df lineViewWithHeightofTop:1 superView:self spacing:-200 color:RGBACOLOR(226,226,226,1) lineHeight:1];
            self.backgroundColor = RGBACOLOR(241, 241, 241, 1);
            [df lineViewWithHeightofTop:frame.size.height superView:self spacing:-20 color:RGBACOLOR(226,226,226,1) lineHeight:1];
            self.titleLabel.textColor = RGBACOLOR(46,51,47,1);
            self.titleLabel.font = [UIFont systemFontOfSize:16];
        }
        
    }
    
    return self;
}

@end
